
class Login:
    driver = ""
    def __init__(self,driver):
        self.driver = driver
    def login(self,username,password):
        input_user = self.driver.find_element_by_xpath('//*[@id="app"]/div[2]/div/div[1]/div[2]/div/form/div[1]/div/div/input')
        input_user.clear()
        input_user.send_keys(username)

        input_pwd = self.driver.find_element_by_xpath('//*[@id="app"]/div[2]/div/div[1]/div[2]/div/form/div[2]/div/div/input')
        input_pwd.clear()
        input_pwd.send_keys(password)

        self.driver.find_element_by_xpath('//*[@id="app"]/div[2]/div/div[1]/div[2]/div/form/div[3]/div/button[1]').click()
    def get_success(self):
        data = self.driver.find_element_by_xpath("//*[@id='app']/div[2]/div/div[2]/div[2]/div[1]/div[1]/div/ul/li[1]/span").text
        return data
    def get_Error(self):
        data=self.driver.find_element_by_xpath("//*[@id='app']/div[2]/div/div[1]/div[2]/div/p").text
        return data